import axiosInstance from "../axiosInstance";

const commentInfo = {
  /**
   * 根据分页获取菜品评论分类信息
   * @param {*} pageIndex  评论页码
   * @param {*} food_name  菜品名称
   * @param {*} start_time  订单开始时间
   * @param {*} end_time 订单结束时间
   * @returns  {Promise<AxiosResponse>}
   */
  getListByPage({ pageIndex, food_name, start_time, end_time }) {
    return axiosInstance.get("/commentInfo/getListByPage", {
      params: {
        pageIndex,
        food_name,
        start_time,
        end_time,
      },
    });
  },

  /**
   * 根据id删除评论
   * @param {*} id 用户id
   * @returns {Promise<AxiosResponse>}
   */
  deleteById({ id }) {
    return axiosInstance.get("/commentInfo/deleteById", {
      params: {
        id,
      },
    });
  },

  /**
   * 根据id显示评论
   * @param {*} id 用户id
   * @returns {Promise<AxiosResponse>}
   */
  setCommentShowById({ id }) {
    return axiosInstance.get("/commentInfo/setCommentShowById", {
      params: {
        id,
      },
    });
  },

  /**
   * 根据id隐藏评论
   * @param {*} id 用户id
   * @returns {Promise<AxiosResponse>}
   */
  setCommentHideById({ id }) {
    return axiosInstance.get("/commentInfo/setCommentHideById", {
      params: {
        id,
      },
    });
  },
};
export default commentInfo;
